package com.idempotent.starter.token;


import com.idempotent.starter.enums.TokenType;

import java.util.UUID;

/**
 * Package: com.wyait.manage.idempotent.token
 * Description：
 * Author: huangjian
 * Date:  2020/9/13 18:12
 * Modified By:
 *
 * @author huangjian
 */
public abstract class TokenService {

    public String getToken() {
        String token = "X-Idempotent-Token-".concat(UUID.randomUUID().toString());
        putToken(token);
        return token;
    }

    protected abstract void putToken(String token);

    public abstract boolean verifyToken(String token);

    protected abstract TokenType support();
}
